// @FileName  :delsubstring.c
// @Time      :2024/3/1 0:17
// @Author    :YKW
//# include <bits/stdc++.h>
//using namespace std;
#include <stdio.h>
#include <string.h>

void main() {
    char str[1000];
    char substr[100];
    fgets(str, sizeof(str), stdin); // 使用fgets读取一行字符串，包括空格
    str[strcspn(str, "\n")] = 0; // 移除字符串末尾的换行符
    fgets(substr, sizeof(substr), stdin);
    substr[strcspn(substr, "\n")] = 0; // 移除子串末尾的换行符
    char *pos = str;
    while ((pos = strstr(pos, substr)) != NULL)
        memmove(pos, pos + strlen(substr), strlen(pos + strlen(substr)) + 1);
    printf("%s", str);

    return 0;
}